<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>入职管理</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css">
</head>
<body>
<style type="text/css">
.onerz{
	width:1100px;
	height:50px;
}
.onerz ul li{
	height:25px;
	color:#999999;
	border:solid 1px #DDDDDD;
	list-style: none;
	float: left;
	font-size:13px;
	margin-left:10px;
	text-align: center;
	line-height:25px;
	cursor: pointer;
}
.onerz ul li:hover{
	border:solid 1px #19AA8D;
	color:#19AA8D;
}
.tabs {
    list-style-type: none;
    height: 30px;
    padding-left: 4px;
    border-style: solid;
    border-width: 0 0 1px 0;
}
.tabs li {
    float: left;
    display: inline-block;
    margin: 0 4px -1px 0;
    padding: 0;
    position: relative;
    border: 0;
}
.tabs li a.tabs-inner{
	height: 30px;
    line-height: 25px;
    width: 70px;
}
#waitbigone{
	margin:auto;
}
	#waitwork,#workcheck,#workresult,#workreason{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#waitwork thead,#workcheck thead,#workresult thead,#workreason thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#waitwork th,#workcheck th,#workresult th,#workreason th{
		background: #6666661a;
	}
	#waitwork td,#workcheck td,#workresult td,#workreason td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}
#waitone{
	width:1110px;
}
#outall,#outalls,#outallss{
	width:80px;
	height:25px;
	font-size:13px;
	color:#999999;
	text-align: center;
    margin-top: 10px;
    line-height: 25px;
    margin-left: 10px;
	border:solid 1px #DDDDDD;
}

.biao_button{
		background:#17AA8D;
		border-radius:3px;
		color:white;
		margin:0 4px;
		padding:2px 3px;
		height:25px;
		border:none;
		outline: none;
		cursor:pointer;
	}
</style>
<script type="text/javascript">
//待转正
$("#waitwork").datagrid({
    url:'selectpositive',
    singleSelect:true,
    columns:[[
		{field:'Staff_name',title:'姓名',width:80},
		{field:'position_name',title:'职位',width:160},
		{field:'depart_name',title:'部门',width:210},
		{field:'Staff_phone',title:'手机号码',width:210},
		{field:'Dateentry',title:'入职日期',width:210},
		{field:'Bwr_Date',title:'试用期到期日',width:210},
		{field:'staff_state',title:'转正状态',width:210,
			 formatter:function(value,row,index){
                 if(value==0){
                    return '未转正';
                 }else if(value==1){
                	 return '已发起转正';
                 }
              }		
		},
		{field:'code',title:'操作',width:300,
			formatter:function formattime(value,row,index){		
				 if(row.staff_state==0){
					 //未转正
					 return "<input class='biao_button' type='button' onClick='positive("+row.staff_id+","+row.Depart_id+")' value='发起转正审批'/>";          
	                 }else if(row.staff_state==1){
	                	 //已发起转正
	                	 return "暂无";
	                 }
				
			}}
		]]
});
//发起转正审批
function positive(a,b){
	$.ajax({
		url:"selectpositivebystaffid",
		type:"post",
		data:{"staff_id":a,"Depart_id":b},
		success:function(data){
			$("#content-admin").panel('open').panel('refresh','hr-informationxz');
		}
	});
}
//转正审批
$("#workcheck").datagrid({
    url:'zhuanzheng-approval',
    singleSelect:true,
    columns:[[
		{field:'Staff_name',title:'姓名',width:80},
		{field:'position_name',title:'职位',width:160},
		{field:'depart_name',title:'部门',width:210},
		{field:'Staff_phone',title:'手机号码',width:210},
		{field:'Dateentry',title:'入职日期',width:210},
		{field:'Bwr_Date',title:'试用期到期日',width:210},
		{field:'code',title:'操作',width:300,
			formatter:function formattime(value,row,index){			    		
				return "<input class='biao_button' type='button' onClick='approval("+row.staff_id+","+row.Depart_id+")' value='审批'/>";          
			}}
		]]
});
//审批
function approval(t,b){
	$.ajax({
		url:"zhuanzhengshpi",
		type:"post",
		data:{"staff_id":t,"Depart_id":b},
		success:function(data){
			$("#content-admin").panel('open').panel('refresh','hr-positiveinformation');
		}
	});
}
//审批结果
$("#workresult").datagrid({
    url:'positivestate',
    singleSelect:true,
    columns:[[
		{field:'Staff_name',title:'姓名',width:80},
		{field:'position_name',title:'职位',width:160},
		{field:'depart_name',title:'部门',width:210},
		{field:'Staff_phone',title:'手机号码',width:210},
		{field:'Bwr_Date',title:'试用期到期日',width:210},
		{field:'become_date',title:'转正日期',width:210},
		{field:'pxapproval_if',title:'审批结果',width:210},
		{field:'code',title:'操作',width:300,
			formatter:function formattime(value,row,index){			    		
				return "<input class='biao_button' type='button' onClick='approval("+row.staff_id+","+row.Depart_id+")' value='查看'/>";          
			}}
		]]
});
//已转正
$("#workreason").datagrid({
    url:'positivestated',
    singleSelect:true,
    columns:[[
		{field:'Staff_name',title:'姓名',width:80},
		{field:'position_name',title:'职位',width:160},
		{field:'depart_name',title:'部门',width:210},
		{field:'Staff_phone',title:'手机号码',width:210},
		{field:'Bwr_Date',title:'试用期到期日',width:210},
		{field:'become_date',title:'转正日期',width:210}
		]]
});
</script>
<div class="RZ-start">
	<div id="waitbigone" class="easyui-tabs">
		<!--待入职  -->
		<div  id="waitone" title="待转正">
			<div class="onerz">
			
		</div>
			<table id="waitwork" class="easyui-datagrid" style="height:300px;margin:10px auto;">
			<tbody></tbody>
		 </table>
		</div>
		
		<!-- 入职审批 -->
		<div id="waittwo" title="转正审批 ">
			<div class="onerz">
				
			</div>
			<table id="workcheck" class="easyui-datagrid" style="height:300px;margin:10px auto;">
			<tbody></tbody>
		 </table>
		</div>
		
		<!-- 审批结果 -->
		<div id="waitthree" title="审批结果 ">
			<div class="onerz">
				
			</div>
			<table id="workresult" class="easyui-datagrid" style="height:300px;margin:10px auto;">
			
			<tbody></tbody>
		 </table>
		</div>
		
		<div id="waitfour" title="已转正  ">
			<div class="onerz">
				
			</div>
			<table id="workreason" class="easyui-datagrid" style="height:300px;margin:10px auto;">
			
			<tbody></tbody>
		 </table>
		</div>
	</div>
</div>
</body>
</html>